﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AddressSelector.aspx.cs" Inherits="Evpo.ContactData.UI.AddressSelector" %>
<%@ Register TagPrefix="local" TagName="AddressList" Src="~/AddressList.ascx"  %>
<%@ Register TagPrefix="local" TagName="ContactInList" Src="~/ContactInList.ascx"%>
<%@ Register TagPrefix="local" TagName="AddressEdit" Src="~/AddressEdit.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link rel="Stylesheet" href="Styles/ContactEditForm.css" type="text/css" />
    <link href="Styles/ContactInList.css" rel="Stylesheet" type="text/css" />
    <link href="Styles/Paginator.css" rel="Stylesheet" type="text/css" />
    <link href="Styles/AddressList.css" rel="Stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:SiteMapPath ID="SiteMapPath1" runat="server">
    </asp:SiteMapPath>
    <br />
    <asp:Label runat="server" 
        ID="uiOnlyOneAddress" Text="Only one address must be selected" Visible="false"  ForeColor="Red" />
    <br />
    <asp:Label runat="server" Text="Contact:" />
    <local:ContactInList 
        runat="server" ID="uiContactInList" ContactItem='<%# ViewModel.LoadContactListItem(ContactID) %>' CanBeSelected="false" />
    
    <h2>Current Address:</h2>
    
    <local:AddressEdit runat="server" ID="uiAddressEdit" IsReadOnly="true" 
        Visible='<%# AddressNotEmpty %>' AddressID='<%# AddressID %>'/>
    <asp:Label runat="server" Visible='<%# !AddressNotEmpty %>' Text="Address is not selected" />
        
    <h2>Change Address:</h2>
    <br />
    <a href='<%# CreateAddressUrl %>'>Create New Address</a>
    <br />
    <br />
    <b>Select Existing Address:</b>
    <br />
    <local:AddressList 
        runat="server" ID="uiAddressList" AddressSelected="uiAddressList_AddressSelected"  />
    
</asp:Content>
